import {playMode} from "../common/js/config";
import desc from '@/assets/desc.json'
import discList from '@/assets/getDiscList.json'
import lyric from '@/assets/lyric.json'
import search from '@/assets/search.json'
import {localStorage,loadPlay,loadFavorite} from "../common/js/cache";

const state ={
  singer:{},
  //播放/暂停
  playing:false,
  //播放   全屏/收起
  fullScreen:false,
  //播放列表
  playlist:[],
  //顺序播放列表=============如果是顺序播放时playList和sequenceList一样，如果是随机播放时，两个列表就不一样
  sequenceList:[],
  //播放模式=====默认顺序播放
  mode: playMode.sequence,
  //当前播放的索引
  currentIndex:-1,
  //推荐页面的歌单详情页
  disc:{},
  desc:desc,
  // purlurl:purlurl
  topList: { },
  //从本地缓存取数据
  searchHistory:localStorage(),
  //存放最近播放===从缓存中取
  playHistory:loadPlay(),
  //收藏
  favoriteList:loadFavorite(),
  //推荐页面的热门歌曲推荐
  discLists:discList,
  //歌词
  lyric:lyric,
  //搜索
  search:search
}
export  default state
